#include <stdio.h>
#include <math.h>
 
int main()
{
	int a, b, n, i, k = 0, f;
	scanf("%d %d", &a, &b);
	for (n = a; n <= b; n++) 
{
		f = 1;
		for (i = 2; i <= sqrt(n); i++)
	    if (n % i == 0) {
				f = 0;
				break;
		                }
		if (f == 1)
			k++;
		if (n == b)
			printf("%d", k);
 
}
 
}